]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Fix regression from e6fd2be
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 3 Oct 2012 00:11:49 +0000 (21:11 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 3 Oct 2012 00:16:28 +0000 (21:16 -0300)
We need to fetch the actor's parent before we reparent, otherwise
we won't put it back properly at the end.

js/ui/dnd.js

index b99eb45cbc0521846c1ec4a3a569915f961a33e6..25769d2c42904614611527124abc4176884523ad 100644 (file)
@@ -267,9 +267,6 @@ const _Draggable = new Lang.Class({
             this._dragOffsetY = this._dragActor.y - this._dragStartY;
         } else {
             this._dragActor = this.actor;
-            this._dragActor.reparent(Main.uiGroup);
-            this._dragActor.raise_top();
-            Shell.util_set_hidden_from_pick(this._dragActor, true);
 
             this._dragActorSource = undefined;
             this._dragOrigParent = this.actor.get_parent();
@@ -277,6 +274,10 @@ const _Draggable = new Lang.Class({
             this._dragOrigY = this._dragActor.y;
             this._dragOrigScale = this._dragActor.scale_x;
 
+            this._dragActor.reparent(Main.uiGroup);
+            this._dragActor.raise_top();
+            Shell.util_set_hidden_from_pick(this._dragActor, true);
+
             let [actorStageX, actorStageY] = this.actor.get_transformed_position();
             this._dragOffsetX = actorStageX - this._dragStartX;
             this._dragOffsetY = actorStageY - this._dragStartY;